#include "widget.h"
#include "ui_widget.h"
#include "customform.h"
#include <QPushButton>
#include <QVBoxLayout>



Widget::Widget(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::Widget)
{
    ui->setupUi(this);
//    Form * fr = new Form(this);
    centralWidget = new QWidget(this);
        setCentralWidget(centralWidget);

        layout = new QVBoxLayout(centralWidget);

        addButton = new QPushButton("Add Custom Form", this);
        connect(addButton, &QPushButton::clicked, this, &MainWindow::addButtonClicked);
        layout->addWidget(addButton);
    }

    void MainWindow::addButtonClicked()
    {
        CustomForm *customForm = new CustomForm(this);
        layout->addWidget(customForm);
    }
Widget::~Widget()
{
    delete ui;
}

